define(function (require, exports, module) {
  var mCard = require('andrew/card/index.js')
  var Element = require('third/element/index.js')

  var app = new Vue({
    data: function () {
      return {
        tableList: []
      }
    },
    mixins: [Element.mixin],
    mounted: function () {
      this.getDataList()
    },
    methods: {
      getDataList: function () {
        this.tableList = [{
          id: '1',
          title: '1空军蓝翔联合培训 军人通过两个月的学习获蓝翔颁发结业证书',
          name: '立方停车',
          toUrl: 'http://www.baidu.com',
          toUrlTarget: '1',
          imgUrl: 'http://www.reformer.com.cn/imageRepository/c3404ac3-bc26-47f0-b7d3-a2f764cefbbd.jpg',
          groupName: '首页轮播',
          groupMark: '用于首页大图轮播...',
          dataFlag: 1
        }, {
          id: '1',
          title: '1空军蓝翔联合培训 军人通过两个月的学习获蓝翔颁发结业证书',
          name: '立方停车',
          toUrl: 'http://www.baidu.com',
          toUrlTarget: '1',
          imgUrl: 'http://www.reformer.com.cn/imageRepository/c3404ac3-bc26-47f0-b7d3-a2f764cefbbd.jpg',
          groupName: '首页轮播',
          groupMark: '用于首页大图轮播...',
          dataFlag: 1
        }, {
          id: '1',
          title: '1空军蓝翔联合培训 军人通过两个月的学习获蓝翔颁发结业证书',
          name: '立方停车',
          toUrl: 'http://www.baidu.com',
          toUrlTarget: '1',
          imgUrl: 'http://www.reformer.com.cn/imageRepository/c3404ac3-bc26-47f0-b7d3-a2f764cefbbd.jpg',
          groupName: '首页轮播',
          groupMark: '用于首页大图轮播...',
          dataFlag: 1
        }]
      },
      handleEdit(index, row) {
        console.log(index, row)
        pageVue = this

        var id = row.id || 0

        // iframe窗
        var index = layer.open({
          type: 2,
          title: '文章基本信息修改',
          shade: [0],
          area: ['80%', '90%'],
          content: ['05_artEdit.html?id=' + id], // iframe的url，no代表不显示滚动条
          end: function () { // 此处用于演示
            // alert(0)

            pageVue.getDataList()
          }
        })
      },
      handleArtEdit(index, row) {
        console.log(index, row)

        top.window.open('artPart.html')
      },

      handleDelete(index, row) {
        console.log(index, row)
      }
    }

  }).$mount('#app')
})
